package com.itfreer.form.dao.metadata;

import org.hibernate.Session;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.itfreer.form.api.JdbcBaseDaoImp;
import com.itfreer.form.entity.metadata.DictionaryEntity;

/**
 * 定义字典服务
 */
@Transactional(readOnly = false)
@Component("jdbcDictionaryDao")
public class JdbcDictionaryDao extends JdbcBaseDaoImp<DictionaryEntity, JdbcDictionaryEntity> implements DictionaryDao {
	
	/**
	 * 删除实体
	 * 
	 * @param guid
	 *            唯一值
	 * @throws IllegalAccessException
	 * @throws InstantiationException
	 */
	public void deleteEx(String dn, String guid) {
		Session session = this.sessionFactory.getCurrentSession();
		JdbcDictionaryEntity jEntity = new JdbcDictionaryEntity();
		jEntity.setId(guid);
		jEntity.setDicName(dn);
		session.delete(jEntity);
	}
}